package com.xxxx.car.flow.service;

import com.xxxx.car.audit.vo.HandleAuditParam;
import com.xxxx.car.audit.vo.HistoryTask;
import com.xxxx.car.flow.domain.BpmnInfo;
import org.activiti.bpmn.model.BpmnModel;
import org.springframework.stereotype.Service;

import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface IProcessService {

    /**
     *  部署流程定义
     * @param bpmnFileName  流程文件名称
     * @param bpmnFileSteam  流程文件输入流对象
     * @return  部署结果
     */
    BpmnInfo depoly(String bpmnFileName, InputStream bpmnFileSteam);

    /**
     *  获取流程定义资源文件
     * @param processDefinitionKey
     * @param version
     * @param type
     * @return
     */
    InputStream getResourceAsStream(String processDefinitionKey, Long version, String type);

    void deleteDefinition(String processDefinitionKey, Long version);

    BpmnModel getBpmnModel(String definitionKey, int version);

    String startProcessInstance(String definitionKey, String businessKey, HashMap<String, Object> variables);

    void deleteProcessInstance(String instanceId, String reason);

    List<String> selectBusinessKeyList(String processDefinitionKey, Long userId);

    boolean handleTaskByInstanceIdAndAssignee(String instanceId, Long userId, HandleAuditParam param);

    List<String> selectHistoryBusinessKeyList(String processDefinitionKey, Long userId,String type);

    List<HistoryTask> selectHistoryTaskListByInstanceId(String instanceId);

    InputStream getProcessingImageByInstanceId(String instanceId);
}
